package com.ivo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.ivo.model.TemplateAttribute;
import com.ivo.web.form.def.Form;

@Component
public class FormPreviewParser
{
	@Autowired
	private FormService formService;

	public String preview(Long tmplId)
	{
		String html = "";
		//------------------------------------------------------------------------------------------------------------------
		List<TemplateAttribute> tmplAttrs = formService.getTmplAttrs( tmplId );
		Form form = parserForm( tmplAttrs );
		//------------------------------------------------------------------------------------------------------------------
		html = parseHtml( form );
		//------------------------------------------------------------------------------------------------------------------
		return html;
	}

	public Form parserForm(List<TemplateAttribute> tmplAttrs)
	{
		Form form = new Form();
		// TODO

		//------------------------------------------------------------------------------------------------------------------
		return form;
	}

	public String parseHtml(Form form)
	{
		String str = "";
		// TODO
		//------------------------------------------------------------------------------------------------------------------
		return str;
	}

}
